package com.tencent.ncnnyolox.net

import com.tencent.ncnnyolox.net.bean.*
import com.tencent.ncnnyolox.net.bean.request.ChatHistoryAddDTO
import com.tencent.ncnnyolox.net.bean.request.ChatHistoryRequest
import com.tencent.ncnnyolox.net.bean.response.ChatHistoryResponse
import com.yd.basemodule.base.bean.BaseResult
import retrofit2.http.*

/**
 * <pre>
 *     author : yh
 *     e-mail : xxx@xx
 *     time   : 2023/12/22
 *     desc   :
 * </pre>
 */
interface ApiService {
    @FormUrlEncoded
    @Headers("Content-Type: application/x-www-form-urlencoded")
    @POST("thirdApi/v3/auth/account_info")
    suspend fun login(@Field("biz_content") bean: String, @Field("format") format:String,
                      @Field("method") method:String, @Field("sign") sign:String, @Field("sign_type") signType:String,
                      @Field("timestamp") timestamp:String, @Field("version") version:String
    ): BaseResult<String>

    @POST("token/check")
    suspend fun check(@Query("helper-token") token:String): BaseResult<String>


    /**
     * 获取用户聊天常用语
     */

    @Headers("Content-Type: application/x-www-form-urlencoded")
    @POST("/api-app/member/phrase/{memberId}")
    suspend fun getCommonWord(@Path("memberId") memberId:String):BaseResult<List<CommonWordBean>>

    /**
     * 修改聊天常用语
     */
    @Headers("Content-Type: application/json")
    @POST("/api-app/member/phrase/update")
    suspend fun updateCommonWord(@Body bean: ChatPhraseUpdateDTO):BaseResult<String>

    /**
     * 添加常用语
     */
    @Headers("Content-Type: application/json")
    @POST("/api-app/member/phrase/add")
    suspend fun addCommonWord(@Body bean: ChatPhraseAddDTO):BaseResult<String>

    /**
     * 删除聊天常用语
     */
    @Headers("Content-Type: application/x-www-form-urlencoded")
    @POST("/api-app/member/phrase/delete/{id}")
    suspend fun deleteCommonWord(@Path("id") id:Long):BaseResult<String>

    /**
     * 获取聊天常用语标签
     */
    @Headers("Content-Type: application/x-www-form-urlencoded")
    @POST("/api-app/member/phrase-label")
    suspend fun getPhraseLabel():BaseResult<List<PhraseLabelBean>>


    /**
     * 获取聊天记录
     */
    @Headers("Content-Type: application/json")
    @POST("/api-app/member/chat-history/page")
    suspend fun getChatRecord(@Body bean:ChatHistoryRequest):BaseResult<List<ChatHistoryResponse>>


    /**
     * 添加聊天记录
     */
    @Headers("Content-Type: application/json")
    @POST("/api-app/member/chat-history/add")
    suspend fun addRecord(@Body bean: ChatHistoryAddDTO):BaseResult<String>
}